/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.barrientosjunior.massfilerenamer.parser.element;

import java.io.File;
import java.text.DecimalFormat;
import java.text.NumberFormat;

/**
 *
 * @author Junior
 */
public class ContTagElement implements Element{

    private File file = null;

    private int cont = 0;
    private int charsNum = 0;

    public ContTagElement(int charsNum) {
        this.charsNum = charsNum;
    }

    @Override
    public String toString(){
        
        String format = "0";
        for (int i = 0; i < charsNum - 1 ; i++) {
            format = format + "0";
        }

        NumberFormat formatter = new DecimalFormat(format);

        return formatter.format(cont);
    }

    public void setFile(File file) {
        this.file = file;
        cont++;
    }

}
